{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "        global_conversation_id  ai_conversation_id  cs_conversation_id  \\\n0                     24609245                 NaN          42473998.0   \n1                     24610275          54348847.0          42474094.0   \n2                     24612665          54351101.0          42474457.0   \n3                     24614520          54352891.0          42474794.0   \n4                     24617840          54354840.0          42476468.0   \n...                        ...                 ...                 ...   \n328528                25099377          54762353.0          42612585.0   \n328529                25099916          54762808.0          42612732.0   \n328530                25100395          54763222.0          42612924.0   \n328531                25105550          54767409.0          42614549.0   \n328532                25113937          54774754.0          42616413.0   \n\n                                                dialogues  turns  ai_turns  \\\n0       [{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...     12         0   \n1       [{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...     13         4   \n2       [{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...      7         4   \n3       [{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...     23         8   \n4       [{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...     11         4   \n...                                                   ...    ...       ...   \n328528  [{\"role\": \"智能客服\", \"content\": \"陈师傅，欢迎使用满帮客服，我是您...      7         4   \n328529  [{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...     11         4   \n328530  [{\"role\": \"智能客服\", \"content\": \"姚师傅，欢迎使用满帮客服，我是您...     23        12   \n328531  [{\"role\": \"智能客服\", \"content\": \"孙师傅，欢迎使用满帮客服，我是您...     19         8   \n328532  [{\"role\": \"智能客服\", \"content\": \"孙老板，欢迎使用满帮客服，我是您...     19         6   \n\n       user_role       user_id is_transfer_manual  crm_record_id  \\\n0             货主  4.000000e+18                  是      265089922   \n1            陆师傅  6.006085e+17                  是      265063262   \n2            曾师傅  4.000000e+18                  是      265102737   \n3            赵师傅  6.006085e+17                  是      265063818   \n4            谢师傅  1.509322e+16                  是      265121030   \n...          ...           ...                ...            ...   \n328528       陈师傅  1.511327e+16                  是      267897925   \n328529       刘师傅  4.000000e+18                  是      267902169   \n328530       姚师傅  6.006085e+17                  是      267905357   \n328531       孙师傅  6.006085e+17                  是      267904098   \n328532        货主  4.000000e+18                  是      267910894   \n\n       major_biz_name minor_biz_name   minimal_biz_name  \\\n0            费用问题（平台）            拉跑货       拉跑货纠纷-司机把货拉跑   \n1         催促投诉或撤销（平台）        费用协商处理中          申请人催促-信息费   \n2        省省-活动及套餐（创新）         司机收费套餐           短途套餐使用规则   \n3            费用问题（平台）            放空费      放空费纠纷-货主不给放空费   \n4            钱包业务（支付）             退款              退款未到账   \n...               ...            ...                ...   \n328528       其他业务（其他）         其他业务咨询              留言无下文   \n328529       账号问题（平台）        上传、修改资料            行驶证-非挂车   \n328530       费用问题（平台）          技术服务费  技术服务费纠纷-投诉技术服务费未退   \n328531    催促投诉或撤销（平台）        费用协商处理中          申请人催促-放空费   \n328532       货主会员（平台）         会员套餐咨询            咨询是否有优惠   \n\n                              conversation_record_detail       day  \n0                                  ['服务标准:司机无理由拉跑货（平台）']  20230507  \n1                            ['服务标准:费用协商单-咨询订金处理进度（平台）']  20230507  \n2                                      ['服务标准:咨询套餐使用方式']  20230507  \n3                  ['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']  20230507  \n4       ['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']  20230507  \n...                                                  ...       ...  \n328528                                    ['服务标准:问题不明确']  20230514  \n328529                                 ['服务标准:特殊车辆审核规则']  20230514  \n328530                         ['服务标准:订金已退—货主原因未承运（平台）']  20230514  \n328531                       ['服务标准:费用单—咨询放空协商处理进度（平台）']  20230514  \n328532                                  ['服务标准:有优惠券已过期']  20230514  \n\n[328533 rows x 15 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>global_conversation_id</th>\n      <th>ai_conversation_id</th>\n      <th>cs_conversation_id</th>\n      <th>dialogues</th>\n      <th>turns</th>\n      <th>ai_turns</th>\n      <th>user_role</th>\n      <th>user_id</th>\n      <th>is_transfer_manual</th>\n      <th>crm_record_id</th>\n      <th>major_biz_name</th>\n      <th>minor_biz_name</th>\n      <th>minimal_biz_name</th>\n      <th>conversation_record_detail</th>\n      <th>day</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>24609245</td>\n      <td>NaN</td>\n      <td>42473998.0</td>\n      <td>[{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...</td>\n      <td>12</td>\n      <td>0</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265089922</td>\n      <td>费用问题（平台）</td>\n      <td>拉跑货</td>\n      <td>拉跑货纠纷-司机把货拉跑</td>\n      <td>['服务标准:司机无理由拉跑货（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>24610275</td>\n      <td>54348847.0</td>\n      <td>42474094.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...</td>\n      <td>13</td>\n      <td>4</td>\n      <td>陆师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063262</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>费用协商处理中</td>\n      <td>申请人催促-信息费</td>\n      <td>['服务标准:费用协商单-咨询订金处理进度（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>24612665</td>\n      <td>54351101.0</td>\n      <td>42474457.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>曾师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265102737</td>\n      <td>省省-活动及套餐（创新）</td>\n      <td>司机收费套餐</td>\n      <td>短途套餐使用规则</td>\n      <td>['服务标准:咨询套餐使用方式']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>24614520</td>\n      <td>54352891.0</td>\n      <td>42474794.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...</td>\n      <td>23</td>\n      <td>8</td>\n      <td>赵师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063818</td>\n      <td>费用问题（平台）</td>\n      <td>放空费</td>\n      <td>放空费纠纷-货主不给放空费</td>\n      <td>['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>24617840</td>\n      <td>54354840.0</td>\n      <td>42476468.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>谢师傅</td>\n      <td>1.509322e+16</td>\n      <td>是</td>\n      <td>265121030</td>\n      <td>钱包业务（支付）</td>\n      <td>退款</td>\n      <td>退款未到账</td>\n      <td>['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>328528</th>\n      <td>25099377</td>\n      <td>54762353.0</td>\n      <td>42612585.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陈师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>陈师傅</td>\n      <td>1.511327e+16</td>\n      <td>是</td>\n      <td>267897925</td>\n      <td>其他业务（其他）</td>\n      <td>其他业务咨询</td>\n      <td>留言无下文</td>\n      <td>['服务标准:问题不明确']</td>\n      <td>20230514</td>\n    </tr>\n    <tr>\n      <th>328529</th>\n      <td>25099916</td>\n      <td>54762808.0</td>\n      <td>42612732.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>刘师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>267902169</td>\n      <td>账号问题（平台）</td>\n      <td>上传、修改资料</td>\n      <td>行驶证-非挂车</td>\n      <td>['服务标准:特殊车辆审核规则']</td>\n      <td>20230514</td>\n    </tr>\n    <tr>\n      <th>328530</th>\n      <td>25100395</td>\n      <td>54763222.0</td>\n      <td>42612924.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"姚师傅，欢迎使用满帮客服，我是您...</td>\n      <td>23</td>\n      <td>12</td>\n      <td>姚师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>267905357</td>\n      <td>费用问题（平台）</td>\n      <td>技术服务费</td>\n      <td>技术服务费纠纷-投诉技术服务费未退</td>\n      <td>['服务标准:订金已退—货主原因未承运（平台）']</td>\n      <td>20230514</td>\n    </tr>\n    <tr>\n      <th>328531</th>\n      <td>25105550</td>\n      <td>54767409.0</td>\n      <td>42614549.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"孙师傅，欢迎使用满帮客服，我是您...</td>\n      <td>19</td>\n      <td>8</td>\n      <td>孙师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>267904098</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>费用协商处理中</td>\n      <td>申请人催促-放空费</td>\n      <td>['服务标准:费用单—咨询放空协商处理进度（平台）']</td>\n      <td>20230514</td>\n    </tr>\n    <tr>\n      <th>328532</th>\n      <td>25113937</td>\n      <td>54774754.0</td>\n      <td>42616413.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"孙老板，欢迎使用满帮客服，我是您...</td>\n      <td>19</td>\n      <td>6</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>267910894</td>\n      <td>货主会员（平台）</td>\n      <td>会员套餐咨询</td>\n      <td>咨询是否有优惠</td>\n      <td>['服务标准:有优惠券已过期']</td>\n      <td>20230514</td>\n    </tr>\n  </tbody>\n</table>\n<p>328533 rows × 15 columns</p>\n</div>"
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "file_name = r'D:\\工作相关内容\\公司项目\\智能机器人\\训练数据\\标注训练集\\20230517.csv'\n",
    "df = pd.read_csv(file_name,sep=\"\\001\")\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "outputs": [
    {
     "data": {
      "text/plain": "       global_conversation_id  ai_conversation_id  cs_conversation_id  \\\n0                    24609245                 NaN          42473998.0   \n1                    24610275          54348847.0          42474094.0   \n2                    24612665          54351101.0          42474457.0   \n3                    24614520          54352891.0          42474794.0   \n4                    24617840          54354840.0          42476468.0   \n...                       ...                 ...                 ...   \n76251                24655490                 NaN          42487259.0   \n76252                24655757          54386935.0          42487312.0   \n76253                24657915          54388777.0          42487869.0   \n76254                24659494          54390214.0          42488218.0   \n76255                24659658          54390368.0          42488250.0   \n\n                                               dialogues  turns  ai_turns  \\\n0      [{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...     12         0   \n1      [{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...     13         4   \n2      [{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...      7         4   \n3      [{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...     23         8   \n4      [{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...     11         4   \n...                                                  ...    ...       ...   \n76251  [{\"role\": \"客户\", \"content\": \"我都说了司机联系不上\", \"is_i...     10         0   \n76252  [{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...     11         4   \n76253  [{\"role\": \"智能客服\", \"content\": \"班师傅，欢迎使用满帮客服，我是您...     15         4   \n76254  [{\"role\": \"智能客服\", \"content\": \"陈老板，欢迎使用满帮客服，我是您...      9         8   \n76255  [{\"role\": \"智能客服\", \"content\": \"王师傅，欢迎使用满帮客服，我是您...      7         4   \n\n      user_role       user_id is_transfer_manual  crm_record_id  \\\n0            货主  4.000000e+18                  是      265089922   \n1           陆师傅  6.006085e+17                  是      265063262   \n2           曾师傅  4.000000e+18                  是      265102737   \n3           赵师傅  6.006085e+17                  是      265063818   \n4           谢师傅  1.509322e+16                  是      265121030   \n...         ...           ...                ...            ...   \n76251        货主  6.006085e+17                  是      265218019   \n76252       刘师傅  9.643639e+16                  是      265214523   \n76253       班师傅  6.006085e+17                  是      265220819   \n76254        货主  4.000000e+18                  是      265218081   \n76255       王师傅  4.000000e+18                  是      265232947   \n\n      major_biz_name minor_biz_name   minimal_biz_name  \\\n0           费用问题（平台）            拉跑货       拉跑货纠纷-司机把货拉跑   \n1        催促投诉或撤销（平台）        费用协商处理中          申请人催促-信息费   \n2       省省-活动及套餐（创新）         司机收费套餐           短途套餐使用规则   \n3           费用问题（平台）            放空费      放空费纠纷-货主不给放空费   \n4           钱包业务（支付）             退款              退款未到账   \n...              ...            ...                ...   \n76251    催促投诉或撤销（平台）          客诉处理中        投诉人投诉催促—拉跑货   \n76252       其他业务（其他）         其他业务咨询             调取客户资料   \n76253       费用问题（平台）          技术服务费  技术服务费纠纷-投诉技术服务费未退   \n76254       其他业务（其他）         其他业务咨询              留言无下文   \n76255       费用问题（平台）            放空费       咨询如果放空之后如何处理   \n\n                             conversation_record_detail       day  \n0                                 ['服务标准:司机无理由拉跑货（平台）']  20230507  \n1                           ['服务标准:费用协商单-咨询订金处理进度（平台）']  20230507  \n2                                     ['服务标准:咨询套餐使用方式']  20230507  \n3                 ['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']  20230507  \n4      ['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']  20230507  \n...                                                 ...       ...  \n76251                           ['服务标准:投诉人咨询处理进度（拉跑货）']  20230507  \n76252                 ['服务标准:你给我哪个货主/司机的信息，我自己找走程序处理。']  20230507  \n76253                         ['服务标准:订金已退—货主原因未承运（平台）']  20230507  \n76254                                      ['服务标准:无交互']  20230507  \n76255                                 ['服务标准:咨询放空赔付金额']  20230507  \n\n[5808 rows x 15 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>global_conversation_id</th>\n      <th>ai_conversation_id</th>\n      <th>cs_conversation_id</th>\n      <th>dialogues</th>\n      <th>turns</th>\n      <th>ai_turns</th>\n      <th>user_role</th>\n      <th>user_id</th>\n      <th>is_transfer_manual</th>\n      <th>crm_record_id</th>\n      <th>major_biz_name</th>\n      <th>minor_biz_name</th>\n      <th>minimal_biz_name</th>\n      <th>conversation_record_detail</th>\n      <th>day</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>24609245</td>\n      <td>NaN</td>\n      <td>42473998.0</td>\n      <td>[{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...</td>\n      <td>12</td>\n      <td>0</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265089922</td>\n      <td>费用问题（平台）</td>\n      <td>拉跑货</td>\n      <td>拉跑货纠纷-司机把货拉跑</td>\n      <td>['服务标准:司机无理由拉跑货（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>24610275</td>\n      <td>54348847.0</td>\n      <td>42474094.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...</td>\n      <td>13</td>\n      <td>4</td>\n      <td>陆师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063262</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>费用协商处理中</td>\n      <td>申请人催促-信息费</td>\n      <td>['服务标准:费用协商单-咨询订金处理进度（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>24612665</td>\n      <td>54351101.0</td>\n      <td>42474457.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>曾师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265102737</td>\n      <td>省省-活动及套餐（创新）</td>\n      <td>司机收费套餐</td>\n      <td>短途套餐使用规则</td>\n      <td>['服务标准:咨询套餐使用方式']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>24614520</td>\n      <td>54352891.0</td>\n      <td>42474794.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...</td>\n      <td>23</td>\n      <td>8</td>\n      <td>赵师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063818</td>\n      <td>费用问题（平台）</td>\n      <td>放空费</td>\n      <td>放空费纠纷-货主不给放空费</td>\n      <td>['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>24617840</td>\n      <td>54354840.0</td>\n      <td>42476468.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>谢师傅</td>\n      <td>1.509322e+16</td>\n      <td>是</td>\n      <td>265121030</td>\n      <td>钱包业务（支付）</td>\n      <td>退款</td>\n      <td>退款未到账</td>\n      <td>['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>76251</th>\n      <td>24655490</td>\n      <td>NaN</td>\n      <td>42487259.0</td>\n      <td>[{\"role\": \"客户\", \"content\": \"我都说了司机联系不上\", \"is_i...</td>\n      <td>10</td>\n      <td>0</td>\n      <td>货主</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265218019</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>客诉处理中</td>\n      <td>投诉人投诉催促—拉跑货</td>\n      <td>['服务标准:投诉人咨询处理进度（拉跑货）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>76252</th>\n      <td>24655757</td>\n      <td>54386935.0</td>\n      <td>42487312.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>刘师傅</td>\n      <td>9.643639e+16</td>\n      <td>是</td>\n      <td>265214523</td>\n      <td>其他业务（其他）</td>\n      <td>其他业务咨询</td>\n      <td>调取客户资料</td>\n      <td>['服务标准:你给我哪个货主/司机的信息，我自己找走程序处理。']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>76253</th>\n      <td>24657915</td>\n      <td>54388777.0</td>\n      <td>42487869.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"班师傅，欢迎使用满帮客服，我是您...</td>\n      <td>15</td>\n      <td>4</td>\n      <td>班师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265220819</td>\n      <td>费用问题（平台）</td>\n      <td>技术服务费</td>\n      <td>技术服务费纠纷-投诉技术服务费未退</td>\n      <td>['服务标准:订金已退—货主原因未承运（平台）']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>76254</th>\n      <td>24659494</td>\n      <td>54390214.0</td>\n      <td>42488218.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陈老板，欢迎使用满帮客服，我是您...</td>\n      <td>9</td>\n      <td>8</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265218081</td>\n      <td>其他业务（其他）</td>\n      <td>其他业务咨询</td>\n      <td>留言无下文</td>\n      <td>['服务标准:无交互']</td>\n      <td>20230507</td>\n    </tr>\n    <tr>\n      <th>76255</th>\n      <td>24659658</td>\n      <td>54390368.0</td>\n      <td>42488250.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"王师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>王师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265232947</td>\n      <td>费用问题（平台）</td>\n      <td>放空费</td>\n      <td>咨询如果放空之后如何处理</td>\n      <td>['服务标准:咨询放空赔付金额']</td>\n      <td>20230507</td>\n    </tr>\n  </tbody>\n</table>\n<p>5808 rows × 15 columns</p>\n</div>"
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_day = df[df[\"day\"]==20230507]\n",
    "df_day"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\fengfeng.qiu\\AppData\\Local\\Temp\\ipykernel_11304\\3998525596.py:13: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame.\n",
      "Try using .loc[row_indexer,col_indexer] = value instead\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  df_day['length'],df_day['num'] = zip(*df_day.apply(caculary_dialogue_len,axis=1))\n"
     ]
    },
    {
     "data": {
      "text/plain": "       global_conversation_id  ai_conversation_id  cs_conversation_id  \\\n0                    24609245                 NaN          42473998.0   \n1                    24610275          54348847.0          42474094.0   \n2                    24612665          54351101.0          42474457.0   \n3                    24614520          54352891.0          42474794.0   \n4                    24617840          54354840.0          42476468.0   \n...                       ...                 ...                 ...   \n76251                24655490                 NaN          42487259.0   \n76252                24655757          54386935.0          42487312.0   \n76253                24657915          54388777.0          42487869.0   \n76254                24659494          54390214.0          42488218.0   \n76255                24659658          54390368.0          42488250.0   \n\n                                               dialogues  turns  ai_turns  \\\n0      [{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...     12         0   \n1      [{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...     13         4   \n2      [{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...      7         4   \n3      [{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...     23         8   \n4      [{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...     11         4   \n...                                                  ...    ...       ...   \n76251  [{\"role\": \"客户\", \"content\": \"我都说了司机联系不上\", \"is_i...     10         0   \n76252  [{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...     11         4   \n76253  [{\"role\": \"智能客服\", \"content\": \"班师傅，欢迎使用满帮客服，我是您...     15         4   \n76254  [{\"role\": \"智能客服\", \"content\": \"陈老板，欢迎使用满帮客服，我是您...      9         8   \n76255  [{\"role\": \"智能客服\", \"content\": \"王师傅，欢迎使用满帮客服，我是您...      7         4   \n\n      user_role       user_id is_transfer_manual  crm_record_id  \\\n0            货主  4.000000e+18                  是      265089922   \n1           陆师傅  6.006085e+17                  是      265063262   \n2           曾师傅  4.000000e+18                  是      265102737   \n3           赵师傅  6.006085e+17                  是      265063818   \n4           谢师傅  1.509322e+16                  是      265121030   \n...         ...           ...                ...            ...   \n76251        货主  6.006085e+17                  是      265218019   \n76252       刘师傅  9.643639e+16                  是      265214523   \n76253       班师傅  6.006085e+17                  是      265220819   \n76254        货主  4.000000e+18                  是      265218081   \n76255       王师傅  4.000000e+18                  是      265232947   \n\n      major_biz_name minor_biz_name   minimal_biz_name  \\\n0           费用问题（平台）            拉跑货       拉跑货纠纷-司机把货拉跑   \n1        催促投诉或撤销（平台）        费用协商处理中          申请人催促-信息费   \n2       省省-活动及套餐（创新）         司机收费套餐           短途套餐使用规则   \n3           费用问题（平台）            放空费      放空费纠纷-货主不给放空费   \n4           钱包业务（支付）             退款              退款未到账   \n...              ...            ...                ...   \n76251    催促投诉或撤销（平台）          客诉处理中        投诉人投诉催促—拉跑货   \n76252       其他业务（其他）         其他业务咨询             调取客户资料   \n76253       费用问题（平台）          技术服务费  技术服务费纠纷-投诉技术服务费未退   \n76254       其他业务（其他）         其他业务咨询              留言无下文   \n76255       费用问题（平台）            放空费       咨询如果放空之后如何处理   \n\n                             conversation_record_detail       day  length  num  \n0                                 ['服务标准:司机无理由拉跑货（平台）']  20230507      91    7  \n1                           ['服务标准:费用协商单-咨询订金处理进度（平台）']  20230507      75    8  \n2                                     ['服务标准:咨询套餐使用方式']  20230507      24    3  \n3                 ['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']  20230507      93   14  \n4      ['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']  20230507      68    6  \n...                                                 ...       ...     ...  ...  \n76251                           ['服务标准:投诉人咨询处理进度（拉跑货）']  20230507     162   14  \n76252                 ['服务标准:你给我哪个货主/司机的信息，我自己找走程序处理。']  20230507      32    6  \n76253                         ['服务标准:订金已退—货主原因未承运（平台）']  20230507     100   11  \n76254                                      ['服务标准:无交互']  20230507      46    4  \n76255                                 ['服务标准:咨询放空赔付金额']  20230507      46    3  \n\n[5808 rows x 17 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>global_conversation_id</th>\n      <th>ai_conversation_id</th>\n      <th>cs_conversation_id</th>\n      <th>dialogues</th>\n      <th>turns</th>\n      <th>ai_turns</th>\n      <th>user_role</th>\n      <th>user_id</th>\n      <th>is_transfer_manual</th>\n      <th>crm_record_id</th>\n      <th>major_biz_name</th>\n      <th>minor_biz_name</th>\n      <th>minimal_biz_name</th>\n      <th>conversation_record_detail</th>\n      <th>day</th>\n      <th>length</th>\n      <th>num</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>24609245</td>\n      <td>NaN</td>\n      <td>42473998.0</td>\n      <td>[{\"role\": \"客户\", \"content\": \"转接人工客服\", \"is_inten...</td>\n      <td>12</td>\n      <td>0</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265089922</td>\n      <td>费用问题（平台）</td>\n      <td>拉跑货</td>\n      <td>拉跑货纠纷-司机把货拉跑</td>\n      <td>['服务标准:司机无理由拉跑货（平台）']</td>\n      <td>20230507</td>\n      <td>91</td>\n      <td>7</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>24610275</td>\n      <td>54348847.0</td>\n      <td>42474094.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陆师傅，欢迎使用满帮客服，我是您...</td>\n      <td>13</td>\n      <td>4</td>\n      <td>陆师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063262</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>费用协商处理中</td>\n      <td>申请人催促-信息费</td>\n      <td>['服务标准:费用协商单-咨询订金处理进度（平台）']</td>\n      <td>20230507</td>\n      <td>75</td>\n      <td>8</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>24612665</td>\n      <td>54351101.0</td>\n      <td>42474457.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"曾师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>曾师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265102737</td>\n      <td>省省-活动及套餐（创新）</td>\n      <td>司机收费套餐</td>\n      <td>短途套餐使用规则</td>\n      <td>['服务标准:咨询套餐使用方式']</td>\n      <td>20230507</td>\n      <td>24</td>\n      <td>3</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>24614520</td>\n      <td>54352891.0</td>\n      <td>42474794.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"赵师傅，欢迎使用满帮客服，我是您...</td>\n      <td>23</td>\n      <td>8</td>\n      <td>赵师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265063818</td>\n      <td>费用问题（平台）</td>\n      <td>放空费</td>\n      <td>放空费纠纷-货主不给放空费</td>\n      <td>['服务标准:货主未提前告知取消订单导致被放空—要求补偿放空费（平台）']</td>\n      <td>20230507</td>\n      <td>93</td>\n      <td>14</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>24617840</td>\n      <td>54354840.0</td>\n      <td>42476468.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"谢师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>谢师傅</td>\n      <td>1.509322e+16</td>\n      <td>是</td>\n      <td>265121030</td>\n      <td>钱包业务（支付）</td>\n      <td>退款</td>\n      <td>退款未到账</td>\n      <td>['服务标准:退款的定金未到账，咨询如何处理', '服务标准:退款的定金未到账，咨询如何处理']</td>\n      <td>20230507</td>\n      <td>68</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>76251</th>\n      <td>24655490</td>\n      <td>NaN</td>\n      <td>42487259.0</td>\n      <td>[{\"role\": \"客户\", \"content\": \"我都说了司机联系不上\", \"is_i...</td>\n      <td>10</td>\n      <td>0</td>\n      <td>货主</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265218019</td>\n      <td>催促投诉或撤销（平台）</td>\n      <td>客诉处理中</td>\n      <td>投诉人投诉催促—拉跑货</td>\n      <td>['服务标准:投诉人咨询处理进度（拉跑货）']</td>\n      <td>20230507</td>\n      <td>162</td>\n      <td>14</td>\n    </tr>\n    <tr>\n      <th>76252</th>\n      <td>24655757</td>\n      <td>54386935.0</td>\n      <td>42487312.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"刘师傅，欢迎使用满帮客服，我是您...</td>\n      <td>11</td>\n      <td>4</td>\n      <td>刘师傅</td>\n      <td>9.643639e+16</td>\n      <td>是</td>\n      <td>265214523</td>\n      <td>其他业务（其他）</td>\n      <td>其他业务咨询</td>\n      <td>调取客户资料</td>\n      <td>['服务标准:你给我哪个货主/司机的信息，我自己找走程序处理。']</td>\n      <td>20230507</td>\n      <td>32</td>\n      <td>6</td>\n    </tr>\n    <tr>\n      <th>76253</th>\n      <td>24657915</td>\n      <td>54388777.0</td>\n      <td>42487869.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"班师傅，欢迎使用满帮客服，我是您...</td>\n      <td>15</td>\n      <td>4</td>\n      <td>班师傅</td>\n      <td>6.006085e+17</td>\n      <td>是</td>\n      <td>265220819</td>\n      <td>费用问题（平台）</td>\n      <td>技术服务费</td>\n      <td>技术服务费纠纷-投诉技术服务费未退</td>\n      <td>['服务标准:订金已退—货主原因未承运（平台）']</td>\n      <td>20230507</td>\n      <td>100</td>\n      <td>11</td>\n    </tr>\n    <tr>\n      <th>76254</th>\n      <td>24659494</td>\n      <td>54390214.0</td>\n      <td>42488218.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"陈老板，欢迎使用满帮客服，我是您...</td>\n      <td>9</td>\n      <td>8</td>\n      <td>货主</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265218081</td>\n      <td>其他业务（其他）</td>\n      <td>其他业务咨询</td>\n      <td>留言无下文</td>\n      <td>['服务标准:无交互']</td>\n      <td>20230507</td>\n      <td>46</td>\n      <td>4</td>\n    </tr>\n    <tr>\n      <th>76255</th>\n      <td>24659658</td>\n      <td>54390368.0</td>\n      <td>42488250.0</td>\n      <td>[{\"role\": \"智能客服\", \"content\": \"王师傅，欢迎使用满帮客服，我是您...</td>\n      <td>7</td>\n      <td>4</td>\n      <td>王师傅</td>\n      <td>4.000000e+18</td>\n      <td>是</td>\n      <td>265232947</td>\n      <td>费用问题（平台）</td>\n      <td>放空费</td>\n      <td>咨询如果放空之后如何处理</td>\n      <td>['服务标准:咨询放空赔付金额']</td>\n      <td>20230507</td>\n      <td>46</td>\n      <td>3</td>\n    </tr>\n  </tbody>\n</table>\n<p>5808 rows × 17 columns</p>\n</div>"
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json\n",
    "def caculary_dialogue_len(item):\n",
    "    total_lenth = 0\n",
    "    total_num = 0\n",
    "    for i in json.loads(item[\"dialogues\"]):\n",
    "        if i['role'] != \"客户\":\n",
    "            continue\n",
    "        total_lenth += len(i['content'])\n",
    "        total_num += 1\n",
    "\n",
    "    return total_lenth,total_num\n",
    "\n",
    "df_day['length'],df_day['num'] = zip(*df_day.apply(caculary_dialogue_len,axis=1))\n",
    "df_day"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "11.547130131739046"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "sum(df_day[\"length\"])/sum(df_day[\"num\"])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}